﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace Vue.Admin.Models.Migrations.DBContextMigrations
{
    public partial class InitialCreate : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "e_Base_Emp",
                columns: table => new
                {
                    FID = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    FName = table.Column<string>(unicode: false, maxLength: 50, nullable: true),
                    FUserName = table.Column<string>(unicode: false, maxLength: 50, nullable: true),
                    FPhone = table.Column<string>(unicode: false, maxLength: 50, nullable: true),
                    FEmail = table.Column<string>(unicode: false, maxLength: 100, nullable: true),
                    FPwd = table.Column<string>(unicode: false, maxLength: 50, nullable: true),
                    FIsDelete = table.Column<int>(nullable: false),
                    FAddTime = table.Column<DateTime>(type: "datetime", nullable: false),
                    FModifyTime = table.Column<DateTime>(type: "datetime", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_e_Base_Emp", x => x.FID);
                });

            migrationBuilder.CreateTable(
                name: "e_Sy_EmpRoleMap",
                columns: table => new
                {
                    FID = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    FEmpID = table.Column<int>(nullable: false),
                    FRoleID = table.Column<int>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_e_Sy_EmpRoleMap", x => x.FID);
                });

            migrationBuilder.CreateTable(
                name: "e_Sys_Roles",
                columns: table => new
                {
                    FID = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    FParentID = table.Column<int>(nullable: false),
                    FName = table.Column<string>(unicode: false, maxLength: 100, nullable: false),
                    FSort = table.Column<int>(nullable: false),
                    FRemark = table.Column<string>(unicode: false, maxLength: 100, nullable: true),
                    FAddTime = table.Column<DateTime>(type: "datetime", nullable: false),
                    FModifyTime = table.Column<DateTime>(type: "datetime", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_e_Sys_Roles", x => x.FID);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "e_Base_Emp");

            migrationBuilder.DropTable(
                name: "e_Sy_EmpRoleMap");

            migrationBuilder.DropTable(
                name: "e_Sys_Roles");
        }
    }
}
